package com.tt.job.api.schedule.triger;

import com.tt.job.api.schedule.JobSchedule;

/**
 * 调度任务的任务触发配置信息
 */
public class TriggerJobSchedule extends JobSchedule {

    private String cronExpression;

    public TriggerJobSchedule(){

    }

    public TriggerJobSchedule(String cron) {
        this.cronExpression = cron;
    }

    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("{");
        builder.append("group:");
        builder.append(getGroup());
        builder.append(", name:");
        builder.append(getName());
        builder.append(", type:");
        builder.append(getType());
        builder.append(", enabled:");
        builder.append(isEnabled());
        builder.append(", retryDelayLevel:");
        builder.append(getRetryDelayLevel());

        builder.append(", cronExpression:");
        builder.append(getCronExpression());
        builder.append("}");

        return builder.toString();
    }
}
